<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let  p = new Promise((resolve,reject)=>{
            //成功调用resolve()
            // setTimeout(()=>{  //异步修改时，点开的状态值和没点开不一样
            //     resolve("success")
            //     console.log('执行了')
            // },1000)

            //失败调用reject，并且会抛出一个错误。
           setTimeout(()=>{
               reject("报错")
           })

        })
        console.log(p);

    </script>
</body>
</html>